﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AlgoritmTeorija
{
    class RandomDataHelper
    {
        private int range;
        private string _fileName;

        public RandomDataHelper(string fileName)
        {
            this._fileName = fileName;
            this.range = 1000;
        }

        public void GenerateRandomNumbers(int quantity)
        {
            FileHelper fileHelper = new FileHelper(_fileName, FileMode.Create);
            Random r = new Random();
            for (int i = 0; i < quantity; i++)
            {
                fileHelper.WriteBinary(r.Next(-range, range));
            }
        }

        public void SetRange(int range)
        {
            if (range > int.MinValue && range < int.MaxValue)
                this.range = range;
        }
    }
}
